<!--  -->
<template>
    <div>
        <ETable v-bind="tableConifg">


            <template #buttons="{ delAll }">
                <el-button type="primary" @click="add()">添加</el-button>
                <el-button type="danger" @click="delAll">批量删除</el-button>
            </template>

            <template #operation="{ row, del }">
                <el-button link type="primary" @click="edit(row.id)">修改</el-button>
                <el-button link type="danger" @click="del(row.id)">删除</el-button>
            </template>
        </ETable>
        <AddAddress @close="closeHandle" v-if="dialogVisible"></AddAddress>
    </div>
</template>

<script lang='ts' setup>
import { reactive, toRefs, ref, onMounted } from 'vue'
import ETable, { TableType } from '../../components/ETable.vue';
import { columns } from './columns';
import { getAddress } from '../../apis/address/address';
import AddAddress from './AddAddress.vue';
const value1 = ref('')

const dialogVisible = ref(false)

const tableConifg: TableType = {
    loadData: getAddress,
    columns
}
const add = () => {

    dialogVisible.value = true

}
const closeHandle = () => {
    dialogVisible.value = false
}
const edit = (id: number) => {

}
</script>
<style scoped></style>